<template>
	<view class="edit_memo_box">
		<MyInput
			label="标题"
			v-model="_formData.title"
			:focus="false"
			fontSize="30rpx" 
			:focusFun="focusFun"
			:borderColor="primary_light_color" 
		/>
		<view class="time_item">
			时间
			<uni-datetime-picker 
				:border="false" 
				type="datetime" 
				v-model="_formData.time" 
				@change="changeLog" 
			/>
		</view>
		<uni-easyinput 
			:primaryColor="primary_cool_color" 
			type="textarea" 
			v-model="_formData.content" 
			placeholder="请输入内容"
			@focus="focusFun"
		/>
	</view>
</template>

<script setup>
	import {ref, watch} from 'vue'
	import MyInput from '@/components/MyInput/MyInput.vue'
	import {
		dynamicStyleStore
	} from '@/stores/dynamicStyle.js'
	
	const dynamicStyle_store = dynamicStyleStore()
	
	const {
		primary_text_color,
		primary_light_color,
		primary_cool_color
	} = dynamicStyle_store.dormitoryStyle	
	
	const props = defineProps({
		formData:{
			type:Object
		}
	})
	const emits = defineEmits(['changeMemoFormEmit'])
	
	const _formData=ref(props.formData)
	watch(()=>props.formData,()=>{
		_formData.value = props.formData
	},{immediate:true})
	
	const focusFun=()=>{
		emits('changeMemoFormEmit',_formData.value)
	}
	const changeLog=(e) =>{
		_formData.value.time=e
		emits('changeMemoFormEmit',_formData.value)
	}
	
</script>

<style lang="less">
	.edit_memo_box{
		.time_item{
			display: flex;
			align-items: center;
			padding-left: 22rpx;
			color: v-bind(primary_text_color);
		}
	}
</style>